import java.util.Random;
import java.util.Scanner;

public class 猜数字游戏 {
    public static void main(String[] args) {
        Random random=new Random();
        int num= random.nextInt(100)+1;
        Scanner sc=new Scanner(System.in);
        while(true){
            System.out.println("请输入你猜的数字：");
            int guessNum= sc.nextInt();
            if(guessNum>num){
                System.out.println("大了");
            } else if (guessNum<num) {
                System.out.println("小了");
            }
            else {
                System.out.println("猜对了");
                break;
            }
        }
    }
}
